package com.qf.business.user.controller;

import com.qf.business.user.service.UserService;
import com.qf.commons.web.aop.UserInfo;
import com.qf.data.base.r.R;
import com.qf.data.base.r.Rs;
import com.qf.data.user.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * description:
 * author: Ken
 * 公众号：Java架构栈
 */
@RestController
@RequestMapping("/user/score")
public class WxUserScoreController {

        @Autowired
        private UserService userService;

        /**
         * 查询用户积分
         * @return
         */
        @RequestMapping("/query")
        public R queryScore(){
                //获取用户id
                Long uid = UserInfo.getUid();
                User user = userService.getById(uid);
                return Rs.create(user.getScore());
        }
}
